<template lang="html">
  <tr>
    <td class="col-sm-1">{{detail.betaId}}</td>
    <td class="col-sm-1">{{detail.name}}</td>
    <td class="col-sm-1">{{detail.subBetaIds}}</td>
    <td class="col-sm-1">{{detail.isList ? '已展示' : '未展示'}}</td>
    <td class="col-sm-1">{{detail.status ? '已上架' : '未上架'}}</td>
    <td class="col-sm-2 text-right">
      <button class="btn btn-sm" v-if=" index === 0 " :style="{ opacity: 0, 'pointer-events': 'none' }">占位</button>
      <button v-if="index !== 0 " class="btn btn-sm btn-success"
        @click="moveUp(index)">上移</button>
      <button v-if="index !== (subtypeList.length-1)" class="btn btn-sm btn-success"
        @click="moveDown(index)">下移</button>
    </td>
    <td class="col-sm-6 text-right">
      <a v-link="{ path: '/betaId/' + detail.betaId, query: {subType: detail.subType}}" class="btn btn-sm btn-primary">订阅量查询</a>
      <update-package-activity
        :detail="deepClone(detail)">
      </update-package-activity>
      <update-invester-buy-type
        :id="detail.betaId"
        :subtype="detail.subType"
        :detail="deepClone(detail)"
        ></update-invester-buy-type>
      <button class="btn btn-sm"
        :class="{'btn-danger': detail.status === 1, 'btn-primary': detail.status === 0}"
       @click="evtSetStatus(detail)">{{detail.status === 1 ? '下架' : '上架'}}</button>
      <button class="btn btn-sm btn-danger" @click="deleteSubtype(detail)">删除</button>
    </td>
  </tr>
</template>

<style src="./package-activity-item.css" scoped></style>
<script src="./package-activity-item.js"></script>
